package com.zzptc.sky.bdsjws.adapter;

import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CheckBox;
import android.widget.TextView;

import com.zzptc.sky.bdsjws.MyApplication;
import com.zzptc.sky.bdsjws.R;
import com.zzptc.sky.bdsjws.views.CircleTextImageView;
import com.zzptc.sky.bdsjws.vo.Contacts;
import com.zzptc.sky.bdsjws.vo.MobileInfo;
import com.zzptc.sky.bdsjws.vo.User;

import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by Administrator on 2017/6/6.
 */

public class ContactAdapter  extends  RecyclerView.Adapter<ContactAdapter.MyHoldView> {
  private List<Contacts>list;
    private User contact;

    public  ContactAdapter(List<Contacts>list) {
       this.list=list;

    }

    @Override
    public MyHoldView onCreateViewHolder(ViewGroup parent, int viewType) {
        return null;
    }

    @Override
    public void onBindViewHolder(MyHoldView holder, int position) {
        //在绑定之前要有数据
        Contacts Contacts=list.get(position);

        holder.ctiv.setText(contact.getName().substring(1));
        holder.tv_namel.setText(contact.getName());

    }

    @Override
    public int getItemCount() {
        return list.size();
    }

    class  MyHoldView extends RecyclerView.ViewHolder {
        @BindView(R.id.tv_name)
        TextView tv_namel;
        @BindView(R.id.tv_tel)
        TextView tv_tel;
        @BindView(R.id.tv_addr)
        TextView tv_addr;
        @BindView(R.id.ctiv)
        CircleTextImageView ctiv;
        @BindView(R.id.cb_choose)
        CheckBox cb_choose;
        public MyHoldView(View itemView) {
            super(itemView);
            ButterKnife.bind(this,itemView);
        }
    }
}
